package cn.uin.domain.family.adapter.repository;

import cn.uin.domain.family.model.entity.HomeFamilyEntity;
import cn.uin.domain.family.model.entity.HomeFamilyListEntity;
import org.springframework.ui.Model;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import java.util.List;

/**
 * @ClassName IFamilyRepository
 * @Description:家庭服务(依赖倒置-获取基础设施层数据)
 * @Author: Administrator
 * @CreateDate: 2025/11/11 15:45
 * @Version: 1.0
 */
public interface IFamilyRepository {

	/**
	 * 根据id获取家庭信息
	 * @param familyId
	 * @return
	 */
	HomeFamilyEntity queryFamilyById(Long familyId);

	/**
	 * 根据用户id获取当前家庭成员
	 * @param userId
	 * @return
	 */
	HomeFamilyListEntity queryFamilyListByUserId(Long userId);

	/**
	 * 获取当前用户外的家庭成员
	 * @param userId
	 * @return
	 */
	List<HomeFamilyListEntity> queryOtherFamilyList(Long userId);

	/**
	 * 校验加入家庭token,并将用户加入家庭
	 * @param token
	 * @param email
	 * @param redirectAttributes
	 * @param model
	 */
	String checkTokenAndActivateAddFamily(String token, String email, Long familyId, RedirectAttributes redirectAttributes, Model model);

	/**
	 * 添加家庭
	 * @param homeFamilyEntity
	 */
	void insert(HomeFamilyEntity homeFamilyEntity);
}
